<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>stapes例子16</title>
    <script type="text/javascript" src="../lib/stapes-0.8.1/stapes.js"></script>
    <script type="text/javascript" src="../lib/jquery-easyui-1.4.2/jquery.min.js"></script>
</head>
<body>
<h1>你好!!!</h1>

<div id="app">11111</div>


<script type="text/javascript">
    function Module(what) {
        this.what = what;
        Stapes.mixinEvents(this);
    }

    Module.prototype.sing = function() {
        this.emit('sing', this.what);
    }

    var m = new Module("Happy Birthday");

    m.on('sing', function(what) {
        console.log("i'm singing " + what + "!");
    });

    m.sing(); // i'm singing Happy Birthday!

</script>


</body>
</html>